package com.dd.dc.entity.users;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.dd.dc.base.domain.DBaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 数据字典表
 * </p>
 *
 * @author JueDream
 * @since 2021-03-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("D_COMMON_CODE")
@ApiModel(value="DCommonCode对象", description="数据字典表")
public class DCommonCode extends DBaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "编号")
    @TableId(value = "C_ID", type = IdType.AUTO)
    private Integer cId;

    @ApiModelProperty(value = "排序号")
    @TableField("C_SORT")
    private Integer cSort;

    @ApiModelProperty(value = "code")
    @TableField("C_CODE")
    private Integer cCode;

    @ApiModelProperty(value = "父code")
    @TableField("C_P_CODE")
    private Integer cPCode;

    @ApiModelProperty(value = "名称")
    @TableField("C_NAME")
    private String cName;

    @ApiModelProperty(value = "内容")
    @TableField("C_CONTENT")
    private String cContent;

    @ApiModelProperty(value = "备注")
    @TableField("C_REMARK")
    private String cRemark;

    @ApiModelProperty(value = "数组字典子集")
    @TableField(exist = false)
    private List<DCommonCode> children = new ArrayList<>();

    public DCommonCode(){}

    @Builder
    public DCommonCode(Integer cId, Integer cSort, Integer cCode, Integer cPCode, String cName, String cContent, String cRemark, List<DCommonCode> children) {
        this.cId = cId;
        this.cSort = cSort;
        this.cCode = cCode;
        this.cPCode = cPCode;
        this.cName = cName;
        this.cContent = cContent;
        this.cRemark = cRemark;
        this.children = children;
    }
}
